package cn.wen.yaling.controller;

import java.util.Arrays;
import java.util.Map;

import cn.wen.yaling.commons.vo.LogQueryVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import cn.wen.yaling.commons.entity.LogEntity;
import cn.wen.yaling.xo.service.LogService;
import cn.wen.yaling.commons.utils.PageUtils;
import cn.wen.yaling.commons.utils.ResultEntity;



/**
 * 
 *
 * @author FY
 * @email 932043654@qq.com
 * @date 2022-08-13 02:07:36
 */
@RestController
public class LogController {

    @Autowired
    private LogService logService;

    @ApiOperation(value = "获取操作日志列表", notes = "获取操作日志列表", response = ResultEntity.class)
    @GetMapping(value = "/admin/log/list")
    public ResultEntity getLogList() {
        return logService.getLogList();
    }

    @ApiOperation(value = "查询获取操作日志列表", notes = "查询获取操作日志列表", response = ResultEntity.class)
    @PostMapping(value = "/admin/log/search/list")
    public ResultEntity searchLogList(@RequestBody LogQueryVO logQueryVO) {
        return logService.searchLogList(logQueryVO);
    }

    @ApiOperation(value = "批量删除操作日志列表", notes = "批量删除操操作日志列表", response = ResultEntity.class)
    @PostMapping(value = "/admin/log/delete")
    public ResultEntity deleteBatchLog(@RequestParam("logIds") Integer[] logIds) {
        return logService.deleteBatchLogByIds(logIds);
    }

}
